package procsim;

public class Coords {
    private int x1, y1, x2, y2;

    public Coords(){
        super();
    }

    public Coords (int x1, int y1, int x2, int y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }

    public int getX1() {
        return x1;
    }

    public int getX2() {
        return x2;
    }

    public int getY1() {
        return y1;
    }

    public int getY2() {
        return y2;
    }

    public void alterX1(int x1){
        this.x1+= x1;
    }

    public void alterY1(int y1){
        this.y1+= y1;
    }

    public void alterX2(int x2){
        this.x2+= x2;
    }

    public void alterY2(int y2){
        this.y2+= y2;
    }

    public void setAll(Coords coords){
        x1 = coords.getX1();
        x2 = coords.getX2();
        y1 = coords.getY1();
        y2 = coords.getY2();
    }

    public void setAll(int x1, int y1, int x2, int y2 ){
        this.x1 = x1;
        this.x2 = x2;
        this.y1 = y1;
        this.y2 = y2;
    }

    public Coords horizontalFlip(){
        return new Coords(x2, y1, x1, y2);
    }

    public Coords verticalFlip(){
        return new Coords(x1, y2, x2, y1);
    }

    @Override
    public String toString(){
        return "["+x1+", "+y1+"; "+x2+", "+y2+"]";
    }
}
